package com.example.service;

import java.util.ArrayList;
import java.util.HashMap;

import android.os.Parcel;
import android.os.Parcelable;

import com.example.project.model.Comer;

public class ComerParcelable implements Parcelable {
	
	
	private int 		Type;
	private String id;
	private ArrayList<HashMap<String, String>> restaurantsList = new ArrayList<HashMap<String, String>>();
	
	public ArrayList<HashMap<String, String>> getRestaurantsList() {
		return restaurantsList;
	}

	public void setRestaurantsList(
			ArrayList<HashMap<String, String>> restaurantsList) {
		this.restaurantsList = restaurantsList;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getId(){
		return this.id;
	}

	public int getType() {
		return Type;
	}

	public void setType(int type) {
		Type = type;
	}

	public String getFrom() {
		return From;
	}

	public void setFrom(String from) {
		From = from;
	}

	public Comer getRestaurant() {
		return restaurant;
	}

	public void setRestaurant(Comer restaurant) {
		this.restaurant = restaurant;
	}

	private String		From; 
	private Comer		restaurant;


	public ComerParcelable(int type) {
		this.setType(type);
		this.setFrom("None");
		
	}	 
		
	public ComerParcelable(int t, String f,Comer restaurant) {
		this.setType(t);
		this.setFrom(f);
		this.setRestaurant(restaurant);
	}
	
	public ComerParcelable(int t, String f,ArrayList<HashMap<String, String>> restaurantsList) {
		this.setType(t);
		this.setFrom(f);
		this.setRestaurantsList(restaurantsList);
	}
	
	public ComerParcelable(int t, String f,String id) {
		this.setType(t);
		this.setFrom(f);
		this.setId(id);
	}
	
    public ComerParcelable(Parcel source){
       
        Type = source.readInt();
        From = source.readString();
        restaurant= (Comer) source.readValue(Comer.class.getClassLoader());
    }
    
    public int describeContents(){
    	return 0;
    }


	public void writeToParcel(Parcel dest, int flags) {
	      dest.writeInt(Type);
	      dest.writeString(From);
	      dest.writeValue(restaurant);    
	}
	
    public static final Parcelable.Creator<  ComerParcelable> CREATOR
    = new Parcelable.Creator< ComerParcelable>() {
    		public   ComerParcelable createFromParcel(Parcel in) {
    			return new   ComerParcelable(in);
    		}

    		public   ComerParcelable[] newArray(int size) {
    			return new   ComerParcelable[size];
    	}
    };
	

	

}
